home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Softshoe / Lisa's Mac Parts / Macintosh Memory / MasterPointerTo.h < prev    next >
Text File  |  2000-06-23  |  670b  |  31 lines

  1. // MasterPointerTo.h
  2.  
  3. #ifndef MasterPointerTo_h
  4. #define MasterPointerTo_h
  5.  
  6. #ifndef MasterPointer_h
  7. #include "MasterPointer.h"
  8. #endif
  9.  
  10. template < class Target >
  11. class MasterPointerTo: public MasterPointer
  12.   {
  13.     public:
  14.         static MasterPointerTo<Target>& Make()
  15.             { return *new( sizeof(Target) ) MasterPointerTo<Target>; }
  16.  
  17.         Target& operator*() const
  18.             { return *static_cast<Target*>( Pointer() ); }
  19.         
  20.         Target *operator->() const
  21.             { return static_cast<Target*>( Pointer() ); }
  22.         
  23.         operator Target*() const
  24.             { return static_cast<Target*>( Pointer() ); }
  25.         
  26.         Target** Handle() const
  27.             { return reinterpret_cast<Target**>( MasterPointer::Handle() ); }
  28.   };
  29.  
  30. #endif
  31.